<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
</body>
</html>
<script>
    //---------结构上的
    // 设置自定义属性
    box.setAttribute("index","100");
    // 获取自定义属性的值
    box.getAttribute("index");
    // 删除自定义属性
    box.removeAttribute("index");
    //---------当成对象，往堆里面添加属性
    box.index=100;
    box.index;
    box["index"];
    delete box[index];
</script>